I have a list of "Row" object and need to click one by one and check if an object exists inside. If that object exists, break or else continue the loop.
But when I run this code, It will click on the first row and check for the object and come back to the initial page . But the test fails when it continues the loop for the second row. The error I'm getting is
You are trying to call the "FindChild" method or property of an object that does not exist.
Can anyone see what I'm doing wrong here.
function test1() {
var i;
var MattersList = Aliases.Teams.formLexisnexisDevMicrosoftTeamsM.table.FindAllChildren("ObjectType", "Row");
for (var i = MattersList.length - 2; i > 0; i--) {
MattersList[i].RefreshMappingInfo;
Log.Message(i);
if (!Aliases.Teams.formLexisnexisDevMicrosoftTeamsM.WaitAliasChild("table", 500).Exists) {
Aliases.Teams.formLexisnexisDevMicrosoftTeamsM.buttonReloadTab.Click();
Delay(4000);
}
MattersList[i].FindChild("Id", "0").FindChild("Id", "0").Click();
if (!Aliases.Teams.formLexisnexisDevMicrosoftTeamsM.WaitAliasChild("TextThereAreNoSuggestedDocuments", 500).Exists) {
break;
}
Aliases.Teams.formLexisnexisDevMicrosoftTeamsM.textMyMatters.Click();
}
}